package com.dagger.constant;

/**
 * 消息常量
 * @author dagger
 *
 */
public class MessageConstants {
	// 订阅的消息key
	private static final String CACHE_MSG_KEY = "mini-push:msg:key:%s";
	// 延时消息队列
	private static final String CACHE_MSG_QUEUE = "mini-push:msg:queue:%s";
	// 延时消息延时的毫秒
	private static final String CACHE_MSG_DELAY_MILLISECOND = "mini-push:msg:delay:%s";

	// 实时消息主题通道
	public static String MSG_REALTIME_CHANNEL = "mini-push:msg:realTimeChannel";

	public static String getDelayQueueKey(String msgKey) {
		return String.format(MessageConstants.CACHE_MSG_QUEUE, msgKey);
	}

	public static String getDelayMillisecondKey(String msgKey) {
		return String.format(MessageConstants.CACHE_MSG_DELAY_MILLISECOND, msgKey);
	}

	public static String getCacheMsgKey(String msgKey) {
		return String.format(MessageConstants.CACHE_MSG_KEY, msgKey);
	}

	public static String getMsgKey(String bussinessType, String bussinessId) {
		return String.format("%s:%s", bussinessType, bussinessId);
	}

}
